package lab_11.com.acme.bankapp.domain.bank;

public abstract class AbstractAccount implements Account {

	protected double balance;

	public AbstractAccount(double balance) {
		this.balance = balance;
	}

	@Override
	public void deposit(double amount) throws IllegalArgumentException {
		if (amount > 0) {
			balance += amount;
		} else {
			throw new IllegalArgumentException("Negative amounts are not allowed.");
		}
	}

	@Override
	public double getBalance() {
		return balance;
	}

}
